#!/bin/bash
#获取cpu核数
cpu_num=$(cat /proc/cpuinfo | grep "processor" | wc -l)

#获取总内存
mem_total=$(free -h | awk 'NR==2{print $2}')

#获取磁盘大小
disk_num=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep disk)
disk_total=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep disk | awk '{sum += $2} END {print sum}')

# 输出信息
echo "CPU核数: $cpu_num"
echo "总内存: $mem_total"
echo "磁盘数量: $disk_num"
echo "磁盘大小: $disk_total"

